home *** CD-ROM | disk | FTP | other *** search
- "abstractView.self,v 1.3 1993/07/18 20:24:04 richards Exp"
- "Abstract views - a simple X interface and widget set for Self"
-
- "This contains things common to heavy, and light weight views"
-
- traits views _AddSlotsIfAbsent: (| ^ abstractView = () |)
- traits views abstractView _Define: (|
- parent*** = traits clonable.
-
- ^ copy = (copyUnrealised).
- ^ copyUnrealised = (copyUnrealised: nil).
-
- "should only be called indirectly (see above)
- but this is the place to override copy"
-
- "this code must be kept in step with the unrealise code"
-
- "_" copyUnrealised: sv = (|c|
- c: resend.copy.
-
- "link ourselves in properly"
- c superView: sv.
-
- "the follow copied"
- c iArea: iArea copy.
-
- c
- ).
-
- sizing* = (|
- ^ area = (iArea copy).
- ^ x = (iArea left).
- ^ y = (iArea top).
- ^ width = (iArea width).
- ^ height = (iArea height).
-
- ^ area: a = (
- "should really generate a size-changed event here ourselves"
- "what about top-level windows?"
- (a == iArea) ifTrue: [^self].
- isRealised ifTrue: [window
- moveResizeX: a left
- Y: a top
- W: a width
- H: a height]
- False: [iArea: a].
- self
- ).
-
- ^ includes: pt = (
- area includes: pt
- ).
-
- ^ translateTo: pt = (
- area: area translateTo: pt.
- ).
- |).
-
- parameters* = (|
- ^ borderWidth = (iBorderWidth).
- ^ borderColour = (iBorderColour).
- ^ background = (iBackground).
- |).
-
- naming* = (|
- ^ markPrefix <- ''.
- ^ name = (iName).
- ^ iconName = (('' >= iIconName) ifTrue: iName False: iIconName).
- ^ name: str = (
- iName: str.
- ifRealised: [
- window name: markPrefix,str.
- window iconName: markPrefix,iconName]).
- ^ iconName: str = (
- iIconName: str.
- ifRealised: [window iconName: markPrefix,str]).
- ^ icon = (iIcon).
- ^ icon: str = (
- iIcon: str.
- (isRealised && [icon != '']) ifTrue:
- [window iconified: false
- Icon: (findBitmap: icon) Input: true]).
- |).
-
- "composite defines this, of course"
- subViews* = (|
- ^ isTopView = (superView isNil).
- ^ topView = (superView isNil ifTrue: [self] False: [superView topView]).
-
- ^ addSubView: v = (notCompoundView).
- ^ removeSubView: v = (notCompoundView).
-
- ^ addToSuperView: v = (v addSubView: self).
- ^ removeFromSuperView =
- (superView notNil ifTrue: [superView removeSubView: self]. self).
-
- ^ setSuperView: sv = (
- superView: sv.
- ).
- |).
-
- events* = (|
- configureNotify: event = (iArea: event area).
- |).
-
- errors* = (|
- _ notCompoundView = (error: 'This is not a composite view').
- _ notYetImplememted: feetcher =
- (warning: ('Feature: 'feetcher,' is not yet implemented'). self).
- _ dunno = (error: 'I dunno..').
- ^ debugMessage: m = (viewManager debugMessage: m).
- |).
-
- modelling* = (|
- ^ model: m = (iModel: m).
- ^ model = (iModel).
-
- ^ noModel = (model: defaultModel).
-
- _ defaultModel = nil.
- |).
-
- hacks* = (|
- "This is a hack!"
- "_" findBitmap: name = (manager findBitmap: name Window: window).
- |).
-
- printing* = (|
- printString = ('abstractView: ',iName).
- |).
-
- |)
-
-
- prototypes views _AddSlotsIfAbsent: (| ^ abstractView = () |)
- prototypes views abstractView _Define: (|
- parent* = traits abstractView.
-
- _ thisObjectPrints = true.
-
- ^_ superView <- nil.
-
- "_" iArea <- (10@10)##(300@@300).
-
- "_" iModel.
-
- _ iName <- 'view'.
- _ iIconName <- ''.
- _ iIcon <- ''.
- |)
-
-